package com.serviceprovider.business.module.sp.transaction.model;

//~--- non-JDK imports --------------------------------------------------------

import com.serviceprovider.business.module.user.model.impl.User;

public class TransactionUserAmount {
    private Integer amount;
    private Integer batchId;
    private Integer id;
    private Integer transactionId;

    /**
     * Lazy attribute
     */
    private User    user;
    private Integer userId;

    public TransactionUserAmount() {}

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setBatchId(Integer batchId) {
        this.batchId = batchId;
    }

    public Integer getBatchId() {
        return batchId;
    }

    public void setTransactionId(Integer transactionId) {
        this.transactionId = transactionId;
    }

    public Integer getTransactionId() {
        return transactionId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public Integer getAmount() {
        return amount;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @Override
    public boolean equals(Object obj) {
        if ((obj == null) ||!(obj instanceof TransactionUserAmount)) {
            return false;
        }

        TransactionUserAmount b  = (TransactionUserAmount) obj;
        boolean               eq = ((id == null) && (b.id == null)) || ((id != null) && id.equals(b.id));

        if (!eq) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        return (id != null)
               ? id.hashCode()
               : 0;
    }
}



